package com.huluobo.high3videoproject.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.huluobo.high3videoproject.R;
import com.huluobo.high3videoproject.bean.CommentBeanResult;
import com.huluobo.high3videoproject.utils.GlideUtils;

import java.util.List;

public class CommentAdapter extends BaseQuickAdapter<CommentBeanResult.CommentBean, BaseViewHolder> {
    public CommentAdapter(int layoutResId, @Nullable List<CommentBeanResult.CommentBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, CommentBeanResult.CommentBean commentBean) {
        ImageView icon = baseViewHolder.getView(R.id.comment_icon);
        GlideUtils.load(getContext(), icon, commentBean.getIcon(), R.drawable.ic_logo, 0, 200);

        baseViewHolder.setText(R.id.comment_user, commentBean.getUsername());
        baseViewHolder.setText(R.id.comment_msg, commentBean.getMsg());
        baseViewHolder.setText(R.id.comment_time, "发布时间:" + commentBean.getCreatetime());
    }
}
